﻿using System.Windows.Media;
using System.Globalization;
using System.Windows.Data;
using System;

namespace NetFlux4i
{
    public class ColorConvertor : IValueConverter
    {
        public object Convert(object value, Type targetType,
                              object parameter, CultureInfo culture)
        {
            string t = value.ToString();
            if (t == "Online")
                return Brushes.Green;
            else if (t == "Indeterminate")
                return Brushes.DarkBlue;
            else
                return Brushes.Red;
        }

        public object ConvertBack(object value, Type targetType,
                                  object parameter, CultureInfo culture)
        {
            return Binding.DoNothing;
        }
    }
}
